Sort event types; chage key name

Andrew Cantino 11 years ago
parent
commit
ee14c2e72b
2 changed files with 3 additions and 2 deletions
  1. 2 1
      app/models/agents/event_formatting_agent.rb
  2. 1 1
      app/views/agents/_form.html.erb

+ 2 - 1
app/models/agents/event_formatting_agent.rb

@@ -54,7 +54,8 @@ module Agents
54 54
       {
55 55
         :instructions => {
56 56
           :message =>  "You received a text <$.text> from <$.fields.from>",
57
-          :content => "Looks like the weather is going to be <$.fields.weather>"},
57
+          :some_other_field => "Looks like the weather is going to be <$.fields.weather>"
58
+        },
58 59
         :mode => "clean",
59 60
         :skip_agent => "false",
60 61
         :skip_created_at => "false"

+ 1 - 1
app/views/agents/_form.html.erb

@@ -24,7 +24,7 @@
24 24
     <div class="control-group type-select">
25 25
       <%= f.label :type, :class => 'control-label' %>
26 26
       <div class="controls">
27
-        <%= f.select :type, options_for_select(Agent.types.map {|type| [type.to_s.gsub(/^.*::/, ''), type.to_s] }, @agent.type), {}, :class => 'span4 select2' %>
27
+        <%= f.select :type, options_for_select(Agent.types.map(&:to_s).sort.map {|type| [type.gsub(/^.*::/, ''), type] }, @agent.type), {}, :class => 'span4 select2' %>
28 28
       </div>
29 29
     </div>
30 30
   <% end %>